/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.opgea.crm.domain.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Admin
 */
@Entity
@Table(name = "companyaddresses")
@NamedQueries({
    @NamedQuery(name = "Companyaddresses.findAll", query = "SELECT c FROM Companyaddresses c")})
public class Companyaddresses implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Column(name = "street1", length = 45)
    private String street1;
    @Column(name = "street2", length = 45)
    private String street2;
    @Column(name = "country", length = 45)
    private String country;
    @Column(name = "state", length = 45)
    private String state;
    @Column(name = "city", length = 45)
    private String city;
    @Column(name = "zip", length = 45)
    private String zip;
    @Basic(optional = false)
    @Column(name = "addressQualifier", nullable = false)
    private int addressQualifier;
    @JoinColumn(name = "company_id", referencedColumnName = "id")
    @ManyToOne
    private Company company;

    public Companyaddresses() {
    }

    public Companyaddresses(Integer id) {
        this.id = id;
    }

    public Companyaddresses(Integer id, int addressQualifier) {
        this.id = id;
        this.addressQualifier = addressQualifier;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getStreet1() {
        return street1;
    }

    public void setStreet1(String street1) {
        this.street1 = street1;
    }

    public String getStreet2() {
        return street2;
    }

    public void setStreet2(String street2) {
        this.street2 = street2;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getZip() {
        return zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    public int getAddressQualifier() {
        return addressQualifier;
    }

    public void setAddressQualifier(int addressQualifier) {
        this.addressQualifier = addressQualifier;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Companyaddresses)) {
            return false;
        }
        Companyaddresses other = (Companyaddresses) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.crm.domain.Companyaddresses[id=" + id + "]";
    }

}
